﻿<%@ Page Title="" Language="C#" MasterPageFile="MobileUser.master" AutoEventWireup="true" CodeFile="ResetPassword.aspx.cs" Inherits="user_ResetPassword" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    
    <form id="form1" runat="server">    
     <section>
<header id="header">
<nav id="nav">
<a href="../default.aspx"><div class="branding"></div></a>
<div class="navpages">
<a href="../default.aspx">
<asp:Image ID="imgTop" runat="server" ImageUrl="../images/button/topnav-back.png" width="49" height="29" border="0" alt="back" BorderWidth="0"  /></a>
</div>
</nav>
</header>
</section>
    <section id="body">
<div class="body">
<asp:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server">
    </asp:ScriptManager>
<%--<h1>Password Recovery</h1>--%>
<br/>      
            <div class="form">
<%--<div class="top"></div>--%>
<div class="body">

 
<div class="pad">
                
<div id="contentBody">
            <table width="100%">
                <tr>
                    <td>
                    <h3>
                            Reset Password</h3>
                        &nbsp;
                        <asp:Label ID="lblAutoKey" Visible="false" runat="server"></asp:Label>
                        <asp:Label ID="lblGUID" Visible="false" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:ValidationSummary ID="vsResetPassword" CssClass="errorSummary" HeaderText="Oops... Please complete the form"
                            runat="server" ValidationGroup="customer" />
                    </td>
                </tr>
                <tr>
                    <td>
                    Enter New Password
                        <asp:TextBox ID="txtNewPassword" runat="server" MaxLength="20" Width="200px" TextMode="Password"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvNewPassword" CssClass="validationErrorControl"
                            runat="server" ControlToValidate="txtNewPassword" Display="Dynamic" ErrorMessage=""
                            Text="" ValidationGroup="customer">
                        </asp:RequiredFieldValidator>
                        <%--<asp:CustomValidator ID="csvNewPassword" runat="server" ClientValidationFunction="CheckPasswordLength"
                            ControlToValidate="txtNewPassword" Display="Dynamic" ErrorMessage="Password length should be at least 6."
                            ValidationGroup="customer">*</asp:CustomValidator>--%>
                    </td>
                </tr>
                <tr>
                    <td>
                    Retype New Password
                        <asp:TextBox ID="txtRetypeNewPassword" runat="server" MaxLength="20" Width="200px"
                            TextMode="Password"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvRetypePassword" CssClass="validationErrorControl"
                            runat="server" ValidationGroup="customer" ErrorMessage="" Text="" Display="Dynamic"
                            ControlToValidate="txtRetypeNewPassword"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:CompareValidator ID="csvRetypePassword" runat="server" CssClass="validationErrorControl"
                            Display="Dynamic" ValidationGroup="customer" ErrorMessage="" Text="Both password should be same."
                            ControlToValidate="txtRetypeNewPassword" ControlToCompare="txtNewPassword"></asp:CompareValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        <%--<asp:ImageButton ID="btnSubmit" ImageUrl="~/images/buttons/button_setpass.gif" OnClientClick="LoadValidationErrorCss();"
                            runat="server" Text="Set Password" OnClick="btnSubmit_Click" ValidationGroup="customer" />--%>
                        <asp:Button ID="btnSubmit" CssClass="button_resetpassword" OnClientClick="LoadValidationErrorCss();if (Page_ClientValidate('customer')){ this.className='button_recoverpassword';}"
                            runat="server" OnClick="btnSubmit_Click" ValidationGroup="customer" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label ID="lblMessage" ForeColor="Red" runat="server"></asp:Label>
                    </td>
                </tr>
            </table>
        </div>
               


<%--<a href="tel:022688222" >
<asp:Image ID="imgCallHotline" runat="server" ImageUrl="~/images/public/hotline_en.png" Width="220" AlternateText="Call us at 02 268 8222" BorderWidth="0" /></a><br />--%>
      
</div>
 
    


</div>

<div class="bottom"></div>
</div>
</div>
</section>
    </form>
    
    <script type="text/javascript">
        function CheckPasswordLength(source, arguments) {
            //var corglen = arguments.Value;
            var cval = arguments.Value;
            var bValid = true;
            var chList = new Array(20);
            var ctrlsource = document.getElementById(source.id);

            //alert("ORG LEN : " + corglen.length + " AFTER : " + cval.length);
            if (cval.indexOf(' ') != -1 || cval.indexOf('\'') != -1
                        || cval.indexOf('\"') != -1 || cval.indexOf('~') != -1) {
                if (ctrlsource.textContent) {
                    ctrlsource.textContent = "Password include invalid character or space!";
                }
                else {
                    ctrlsource.innerText = "Password include invalid character or space!";
                }

                ctrlsource.errormessage = "Password include invalid character or space!";
                bValid = false;
            }
            else if (cval.length < 6) {
                //ctrlsource.innerText = "Password length should be at least 6";
                if (ctrlsource.textContent) {
                    ctrlsource.textContent = "Password length should be at least 6";
                }
                else {
                    ctrlsource.innerText = "Password length should be at least 6";
                }

                ctrlsource.errormessage = "Password length should be at least 6";
                bValid = false;
            }
            else if (cval.length > 20) {
                bValid = false;
                //ctrlsource.innerText = "Password length should not be over 20!";
                if (ctrlsource.textContent) {
                    ctrlsource.textContent = "Password length should not be over 20!";
                }
                else {
                    ctrlsource.innerText = "Password length should not be over 20!";
                }
                ctrlsource.errormessage = "Password length should not be over 20!";
            }
            else {
                bValid = true;
            }
            //alert(cval);
            //if (isNaN(cval)){
            //    bValid = false;
            //} 


            //alert(bValid);
            arguments.IsValid = bValid;
            return;
        }
    </script>
</asp:Content>

